﻿using System.Collections.Generic;
using System.Web.Mvc;

namespace ExtendedMvc.Elements {
	public class GridCommand<TModel> : GridCommandBase<GridCommand<TModel>, TModel>
		where TModel : class {
		private string _link;

		public GridCommand(IModelViewHelper<IEnumerable<TModel>> helper, string text, string link)
			: base(helper, text) {
			_link = link;
		}

		public override string GetLink() {
			return UrlHelper.GenerateContentUrl(_link, helper.ViewContext.HttpContext); ;
		}
	}
}
